﻿//
// Decompiled with: Decompiler.NET, Version=1.3.1.18439, Culture=neutral, PublicKeyToken=null, Version: 1.3.1.18439
// Decompilation Started at: 3/15/2009 10:34:26 PM
// Copyright 2003 - 2004, Jungle Creatures, Inc., All Rights Reserved. 
// Written by Jonathan Pierce, Email: support@junglecreatures.com
//

namespace PatientManagement

{
		
		#region Namespace Import Declarations
		
			using System.Collections;
			using System.ComponentModel;
			using System.Data.Common;
			using System.Data;
			using System.Data.SqlClient;
			using System.Drawing;
			using System;
			using System.Windows.Forms;
			using Utility;
			
		#endregion
		
	public class frmToaThuocMau : Form
	
	{
		
		#region Fields
			public string _clrISN;
			private ArrayList arrTong;
			private Button btAdd;
			private Button btDelete;
			private Button btNhap;
			private Button btThoat;
			private Button btUpdate;
			private Button btXoaToaThuoc;
			private ComboBox cboCachDung;
			private ComboBox cboCuUong;
			private ComboBox cboDonVi;
			private ComboBox cboDSLoaiBenh;
			private ComboBox cboISN;
			private ComboBox cboLuuY;
			private ComboBox cboSick;
			private IContainer components;
			private string connStr;
			private int count;
			private DataGrid dataGrid1;
			private Database_Com db;
			private DataSet dsView;
			private DataTable dtView;
			public int flag;
			private Label label1;
			private Label label10;
			private Label label2;
			private Label label3;
			private Label label5;
			private Label label6;
			private Label label7;
			private Label lbCuUong;
			private Label lbLanUong;
			private Label lbNgayUong;
			private LinkLabel linkTenThuoc;
			private TextBox tbLanUong;
			private TextBox tbNgayUong;
			private TextBox tbSoLuong;
			private ToolTip toolTip1;
			private TextBox txtDonVi;
			private TextBox txtISN;
			private TextBox txtLoaiBenh;
			private TextBox txtSoLuongKho;
			private TextBox txtSTT;
			private TextBox txtTenThuoc;
		#endregion
		
		#region Constructors
		
			public frmToaThuocMau ()
			
			{
				this.flag = 1;
				this.db = new Database_Com ();
				this.arrTong = new ArrayList ();
				this.count = 0;
				this.InitializeComponent ();
				this.connStr = Connection.ConnectionString ();
				this.dtView = new DataTable ("ExportMedicineList");
				DataColumn theDataColumn = this.dtView.Columns.Add ("STT");
                DataColumn theDataColumn2 = this.dtView.Columns.Add("Tên Thuốc");
                DataColumn theDataColumn3 = this.dtView.Columns.Add("Số Lượng");
                DataColumn theDataColumn4 = this.dtView.Columns.Add("Đơn vị");
                DataColumn theDataColumn5 = this.dtView.Columns.Add("Ngày SD/ Lần");
                DataColumn theDataColumn6 = this.dtView.Columns.Add("Lần");
                DataColumn theDataColumn7 = this.dtView.Columns.Add("Đơn Vị Dùng");
                DataColumn theDataColumn8 = this.dtView.Columns.Add("Cử");
                DataColumn theDataColumn9 = this.dtView.Columns.Add("Cách SD");
                DataColumn theDataColumn10 = this.dtView.Columns.Add("Lưu \x00dd");
				DataColumn theDataColumn11 = this.dtView.Columns.Add ("YesOrNo");
				DataColumn theDataColumn12 = this.dtView.Columns.Add ("mexISN");
				this.dsView = new DataSet ();
				return;
			}
			
		#endregion
		
		#region Methods
		
			private void btAdd_Click (object sender, EventArgs e)
			
			{
				long theLong;
				SqlDataAdapter theSqlDataAdapter;
				DataSet theDataSet;
				DataRow theDataRow;
				ArrayList theArrayList;
				int i;
				int i2;
				int i3;
				int i4;
				int i5;
				int i6;
				int i7;
				int i8;
				if (! this.check ())
				{
					goto L_0645;
				}
				
			L_000D:
				
				{
				}
				this.tbLanUong_Leave (sender, e);
				theLong = Convert.ToInt64 (this.tbSoLuong.Text);
				if (theLong != ((long) 0))
				{
					goto L_005A;
				}
                DialogResult theDialogResult = MessageBox.Show("Vui lòng nhập số lượng lớn hơn 0.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				bool theBoolean = this.tbSoLuong.Focus ();
				this.tbSoLuong.SelectAll ();
				goto L_0645;
				
			L_005A:
				
				{
				}
                if ((this.cboDSLoaiBenh.Text != "Thêm toa thuốc mới") && (this.txtLoaiBenh.Text == this.cboDSLoaiBenh.Text))
				{
					goto L_0142;
				}
				
			L_0091:
				
				{
				}
				theSqlDataAdapter = new SqlDataAdapter ("Select samISN from SamplePrescription where samSickName = @param", this.connStr);
				SqlParameter theSqlParameter = theSqlDataAdapter.SelectCommand.Parameters.Add ("@param", SqlDbType.NVarChar, 100);
				theSqlDataAdapter.SelectCommand.Parameters["@param"].Value = this.txtLoaiBenh.Text;
				theDataSet = new DataSet ();
				int i9 = theSqlDataAdapter.Fill (theDataSet, "SamplePrescription");
				theSqlDataAdapter.Dispose ();
				if (theDataSet.Tables[0].Rows.Count <= 0)
				{
					goto L_0142;
				}
                DialogResult theDialogResult2 = MessageBox.Show("Loại bệnh này đã có toa thuốc.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				bool theBoolean2 = this.txtLoaiBenh.Focus ();
				this.txtLoaiBenh.SelectAll ();
				goto L_0645;
				
			L_0142:
				
				{
				}
				theDataRow = this.dtView.NewRow ();
				theArrayList = new ArrayList ();
				int i10 = theArrayList.Add ((this.count = (this.dtView.Rows.Count + 1)).ToString ());
				int i11 = theArrayList.Add (this.cboSick.SelectedItem.ToString ());
				int i12 = theArrayList.Add (this.tbSoLuong.Text);
				int i13 = theArrayList.Add (this.cboDonVi.Text);
				int i14 = theArrayList.Add (this.tbNgayUong.Text);
				int i15 = theArrayList.Add (this.tbLanUong.Text);
				int i16 = theArrayList.Add (this.txtDonVi.Text);
				int i17 = theArrayList.Add (this.cboCuUong.Text);
				int i18 = theArrayList.Add (this.cboCachDung.Text);
				int i19 = theArrayList.Add (this.cboLuuY.Text);
				int i20 = theArrayList.Add ("1");
				int i21 = theArrayList.Add (this.txtISN.Text);
				theDataRow[0] = theArrayList[0];
				theDataRow[1] = theArrayList[1];
				theDataRow[2] = theArrayList[2];
				theDataRow[3] = theArrayList[3];
				theDataRow[4] = theArrayList[4];
				theDataRow[5] = theArrayList[5];
				theDataRow[6] = theArrayList[6];
				theDataRow[7] = theArrayList[7];
				theDataRow[8] = theArrayList[8];
				theDataRow[9] = theArrayList[9];
				theDataRow[10] = theArrayList[10];
				theDataRow[11] = theArrayList[11];
				this.dtView.Rows.Add (theDataRow);
				this.loadDataSet ();
				i = 0;
				i2 = 0;
				goto L_0475;
				
			L_032C:
				
				{
				}
				if (this.arrTong[i2].ToString () != this.txtISN.Text)
				{
					goto L_046F;
				}
				if (this.arrTong[i2].ToString () == "0")
				{
					goto L_046F;
				}
                DialogResult theDialogResult3 = MessageBox.Show("Vui lòng chọn tên thuốc khác. \nT\x00ean thuốc này đã tồn tại trong danh sách thuốc đã kê.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				i3 = 0;
				goto L_03FC;
				
			L_038C:
				
				{
				}
				if (this.dsView.Tables["ExportMedicineList"].Rows[i3]["mexISN"].ToString () != this.txtISN.Text)
				{
					goto L_03F6;
				}
				this.dsView.Tables["ExportMedicineList"].Rows[i3].Delete ();
				goto L_0413;
				
			L_03F6:
				
				{
				}
				i3++;
				
			L_03FC:
				
				{
				}
				if (i3 < this.dtView.Rows.Count)
				{
					goto L_038C;
				}
				
			L_0413:
				
				{
				}
				i4 = 0;
				goto L_0447;
				
			L_0418:
				
				{
				}
				this.dtView.Rows[i4]["STT"] = (i5 = (i4 + 1)).ToString ();
				i4++;
				
			L_0447:
				
				{
				}
				if (i4 < this.dsView.Tables["ExportMedicineList"].Rows.Count)
				{
					goto L_0418;
				}
				goto L_0645;
				
			L_046F:
				
				{
				}
				i2++;
				
			L_0475:
				
				{
				}
				if (i2 < this.arrTong.Count)
				{
					goto L_032C;
				}
				i6 = 0;
				goto L_05A7;
				
			L_048F:
				
				{
				}
				if (this.dsView.Tables["ExportMedicineList"].Rows[i6]["mexISN"].ToString () != this.txtISN.Text)
				{
					goto L_0513;
				}
				if (this.dsView.Tables["ExportMedicineList"].Rows[i6]["mexISN"].ToString () == "0")
				{
					goto L_0513;
				}
				i++;
				
			L_0513:
				
				{
				}
				if (i != 2)
				{
					goto L_05A1;
				}
                DialogResult theDialogResult4 = MessageBox.Show("Vui lòng chọn tên thuốc khác. \nT\x00ean thuốc này đã tồn tại trong danh sách thuốc đã kê.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.dsView.Tables["ExportMedicineList"].Rows[i6].Delete ();
				i7 = 0;
				goto L_0588;
				
			L_0559:
				
				{
				}
				this.dtView.Rows[i7]["STT"] = (i8 = (i7 + 1)).ToString ();
				i7++;
				
			L_0588:
				
				{
				}
				if (i7 < this.dtView.Rows.Count)
				{
					goto L_0559;
				}
				goto L_0645;
				
			L_05A1:
				
				{
				}
				i6++;
				
			L_05A7:
				
				{
				}
				if (i6 < this.dsView.Tables["ExportMedicineList"].Rows.Count)
				{
					goto L_048F;
				}
				this.cboCachDung.Text = "";
				this.tbSoLuong.Text = "";
				this.txtDonVi.Text = "";
				this.tbLanUong.Text = "";
				this.tbNgayUong.Text = "";
				this.cboSick.SelectedIndex = 0;
				this.cboLuuY.Text = "";
				this.txtLoaiBenh.ReadOnly = true;
				
			L_0645:
				return;
			}
			
			private void btDelete_Click (object sender, EventArgs e)
			
			{
				int i;
				if (this.dataGrid1.DataSource == null)
				{
					goto L_01C5;
				}
				
			L_0012:
				
				{
				}
				if (this.dsView.Tables["ExportMedicineList"].Rows.Count == 0)
				{
					goto L_01C5;
				}
				
			L_0038:
				
				{
				}
				if (this.tbSoLuong.Text != "")
				{
					goto L_0067;
				}
                DialogResult theDialogResult = MessageBox.Show("Vui lòng chọn tên thuốc từ danh sách nhập.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				goto L_01C5;
				
			L_0067:
				
				{
				}
				this.dsView.Tables["ExportMedicineList"].Rows[this.dataGrid1.CurrentRowIndex].Delete ();
				i = 0;
				goto L_0102;
				
			L_009A:
				
				{
				}
				if (this.dsView.Tables["ExportMedicineList"].Rows.Count != 0)
				{
					goto L_00CC;
				}
				this.dataGrid1.DataSource = null;
				goto L_01C5;
				
			L_00CC:
				
				{
				}
				this.dsView.Tables["ExportMedicineList"].Rows[i]["STT"] = (i + 1);
				i++;
				
			L_0102:
				
				{
				}
				if (i < this.dsView.Tables["ExportMedicineList"].Rows.Count)
				{
					goto L_009A;
				}
				this.arrTong.Remove (this.txtISN.Text);
				this.txtDonVi.Text = "";
				this.cboCachDung.Text = "";
				this.tbSoLuong.Text = "";
				this.txtDonVi.Text = "";
				this.tbLanUong.Text = "";
				this.tbNgayUong.Text = "";
				this.cboSick.SelectedIndex = 0;
				this.cboDonVi.SelectedIndex = 0;
				this.cboLuuY.Text = "";
				
			L_01C5:
				return;
			}
			
			private void btNhap_Click (object sender, EventArgs e)
			
			{
				string theString;
				SqlDataAdapter theSqlDataAdapter;
				DataSet theDataSet;
				int i;
				string theString2;
				string theString3;
				string theString4;
				string theString5;
				string theString6;
				string theString7;
				string theString8;
				string theString9;
				string theString10;
				SqlDataAdapter theSqlDataAdapter2;
				DataSet theDataSet2;
				int i2;
				string[] theStringArray;
				SqlDbType[] theSqlDbTypeArray;
				object[] theObjectArray;
				string[] theStringArray2;
				SqlDbType[] theSqlDbTypeArray2;
				object[] theObjectArray2;
				if ((this.dataGrid1.DataSource != null) && (this.dsView.Tables["ExportMedicineList"].Rows.Count != 0))
				{
					goto L_005E;
				}
				
			L_002E:
				
				{
				}
                DialogResult theDialogResult = MessageBox.Show("Vui lòng nhập chi tiết cho toa thuốc mới.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				bool theBoolean = this.txtLoaiBenh.Focus ();
				this.dataGrid1.DataSource = null;
				goto L_07A8;
				
			L_005E:
				
				{
				}
				theString = string.Empty;
                if (this.cboDSLoaiBenh.Text == "Thêm toa thuốc mới")
				{
					goto L_01EC;
				}
				if (this.txtLoaiBenh.Text != "")
				{
					goto L_00B9;
				}
                DialogResult theDialogResult2 = MessageBox.Show("Vui lòng nhập tên loại bệnh cho toa thuốc này.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				bool theBoolean2 = this.txtLoaiBenh.Focus ();
				goto L_07A8;
				
			L_00B9:
				
				{
				}
				if (this.txtLoaiBenh.Text.ToUpper () == this.cboDSLoaiBenh.Text.ToUpper ())
				{
					goto L_0194;
				}
				theSqlDataAdapter = new SqlDataAdapter ("Select samISN from SamplePrescription where samSickName = @param", this.connStr);
				SqlParameter theSqlParameter = theSqlDataAdapter.SelectCommand.Parameters.Add ("@param", SqlDbType.NVarChar, 100);
				theSqlDataAdapter.SelectCommand.Parameters["@param"].Value = this.txtLoaiBenh.Text;
				theDataSet = new DataSet ();
				int i3 = theSqlDataAdapter.Fill (theDataSet, "SamplePrescription");
				theSqlDataAdapter.Dispose ();
				if (theDataSet.Tables[0].Rows.Count <= 0)
				{
					goto L_0194;
				}
                DialogResult theDialogResult3 = MessageBox.Show("Loại bệnh này đã có toa thuốc.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				bool theBoolean3 = this.txtLoaiBenh.Focus ();
				this.txtLoaiBenh.SelectAll ();
				goto L_07A8;
				
			L_0194:
				
				{
				}
				SqlConnection theSqlConnection = this.db.CreateConnections ();
				theStringArray = new string[1];
				theStringArray[0] = "@samSickName";
				theSqlDbTypeArray = new SqlDbType[1];
				theSqlDbTypeArray[0] = SqlDbType.NVarChar;
				theObjectArray = new object[1];
				theObjectArray[0] = this.cboDSLoaiBenh.Text;
				this.db.ExecuteStoredProc ("sp_SamplePrescription_Delete", theStringArray, theSqlDbTypeArray, theObjectArray);
				
			L_01EC:
				
				{
				}
				i = 0;
				goto L_060B;
				
			L_01F3:
				
				{
				}
                if (this.dsView.Tables["ExportMedicineList"].Rows[i]["Đơn Vị"].ToString() != "viên")
				{
					goto L_0239;
				}
				theString = "0";
				goto L_0349;
				
			L_0239:
				
				{
				}
                if (this.dsView.Tables["ExportMedicineList"].Rows[i]["Đơn Vị"].ToString() != "ống")
				{
					goto L_027F;
				}
				theString = "1";
				goto L_0349;
				
			L_027F:
				
				{
				}
                if (this.dsView.Tables["ExportMedicineList"].Rows[i]["Đơn Vị"].ToString() != "chai")
				{
					goto L_02C5;
				}
				theString = "2";
				goto L_0349;
				
			L_02C5:
				
				{
				}
                if (this.dsView.Tables["ExportMedicineList"].Rows[i]["Đơn Vị"].ToString() != "gói")
				{
					goto L_0308;
				}
				theString = "3";
				goto L_0349;
				
			L_0308:
				
				{
				}
                if (this.dsView.Tables["ExportMedicineList"].Rows[i]["Đơn Vị"].ToString() != "tuýp")
				{
					goto L_0349;
				}
				theString = "4";
				
			L_0349:
				
				{
				}
				theString2 = this.dsView.Tables["ExportMedicineList"].Rows[i][1].ToString ();
				theString3 = this.dsView.Tables["ExportMedicineList"].Rows[i][2].ToString ();
				theString4 = this.dsView.Tables["ExportMedicineList"].Rows[i][4].ToString ();
				theString5 = this.dsView.Tables["ExportMedicineList"].Rows[i][5].ToString ();
				theString6 = this.dsView.Tables["ExportMedicineList"].Rows[i][6].ToString ();
				theString7 = this.dsView.Tables["ExportMedicineList"].Rows[i][7].ToString ();
				theString8 = this.dsView.Tables["ExportMedicineList"].Rows[i][8].ToString ();
				theString9 = this.dsView.Tables["ExportMedicineList"].Rows[i][9].ToString ();
				theString10 = this.dsView.Tables["ExportMedicineList"].Rows[i]["mexISN"].ToString ();
				theStringArray2 = new string[11];
				theStringArray2[0] = "@mimID";
				theStringArray2[1] = "@samSickName";
				theStringArray2[2] = "@mexMedicineName";
				theStringArray2[3] = "@mexUsage";
				theStringArray2[4] = "@mexQuantityPerUnit";
				theStringArray2[5] = "@mexProductionPerUnit";
				theStringArray2[6] = "@mexTakePerDay";
				theStringArray2[7] = "@mexQuantityPerDay";
				theStringArray2[8] = "@mexUsagePerDay";
				theStringArray2[9] = "@mexUsageUnit";
				theStringArray2[10] = "@mexNote";
				theSqlDbTypeArray2 = new SqlDbType[11];
				theSqlDbTypeArray2[0] = SqlDbType.VarChar;
				theSqlDbTypeArray2[1] = SqlDbType.NVarChar;
				theSqlDbTypeArray2[2] = SqlDbType.NVarChar;
				theSqlDbTypeArray2[3] = SqlDbType.NVarChar;
				theSqlDbTypeArray2[4] = SqlDbType.Int;
				theSqlDbTypeArray2[5] = SqlDbType.TinyInt;
				theSqlDbTypeArray2[6] = SqlDbType.Int;
				theSqlDbTypeArray2[7] = SqlDbType.NVarChar;
				theSqlDbTypeArray2[8] = SqlDbType.NVarChar;
				theSqlDbTypeArray2[9] = SqlDbType.NVarChar;
				theSqlDbTypeArray2[10] = SqlDbType.NVarChar;
				theObjectArray2 = new object[11];
				theObjectArray2[0] = theString10;
				theObjectArray2[1] = this.txtLoaiBenh.Text;
				theObjectArray2[2] = theString2;
				theObjectArray2[3] = theString8;
				theObjectArray2[4] = theString3;
				theObjectArray2[5] = theString;
				theObjectArray2[6] = theString4;
				theObjectArray2[7] = theString5;
				theObjectArray2[8] = theString7;
				theObjectArray2[9] = theString6;
				theObjectArray2[10] = theString9;
				this.db.ExecuteStoredProc ("sp_SamplePrescription_Insert", theStringArray2, theSqlDbTypeArray2, theObjectArray2);
				i++;
				
			L_060B:
				
				{
				}
				if (i < this.dsView.Tables["ExportMedicineList"].Rows.Count)
				{
					goto L_01F3;
				}
                DialogResult theDialogResult4 = MessageBox.Show("Toa thuốc đã được lưu.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.cboCachDung.Text = "";
				this.tbSoLuong.Text = "";
				this.txtDonVi.Text = "";
				this.tbLanUong.Text = "";
				this.tbNgayUong.Text = "";
				this.cboSick.SelectedIndex = 0;
				this.cboLuuY.Text = "";
				this.txtLoaiBenh.Text = string.Empty;
				this.txtLoaiBenh.ReadOnly = false;
				this.dataGrid1.DataSource = null;
				theSqlDataAdapter2 = new SqlDataAdapter ("Select distinct samSickName from SamplePrescription", this.connStr);
				theDataSet2 = new DataSet ();
				int i4 = theSqlDataAdapter2.Fill (theDataSet2, "SamplePrescription");
				theSqlDataAdapter2.Dispose ();
				this.cboDSLoaiBenh.Items.Clear ();
                int i5 = this.cboDSLoaiBenh.Items.Add("Thêm toa thuốc mới");
				if (theDataSet2.Tables[0].Rows.Count <= 0)
				{
					goto L_079C;
				}
				i2 = 0;
				goto L_0781;
				
			L_074B:
				
				{
				}
				int i6 = this.cboDSLoaiBenh.Items.Add (theDataSet2.Tables[0].Rows[i2][0]);
				i2++;
				
			L_0781:
				
				{
				}
				if (i2 < theDataSet2.Tables[0].Rows.Count)
				{
					goto L_074B;
				}
				
			L_079C:
				
				{
				}
				this.cboDSLoaiBenh.SelectedIndex = 0;
				
			L_07A8:
				return;
			}
			
			private void btThoat_Click (object sender, EventArgs e)
			
			{
				base.Close ();
				return;
			}
			
			private void btUpdate_Click (object sender, EventArgs e)
			
			{
				int i;
				int i2;
				int i3;
				if (this.dataGrid1.DataSource == null)
				{
					goto L_0457;
				}
				
			L_0012:
				
				{
				}
				if (this.dsView.Tables["ExportMedicineList"].Rows.Count == 0)
				{
					goto L_0457;
				}
				
			L_0038:
				
				{
				}
				if (this.tbSoLuong.Text != "")
				{
					goto L_0067;
				}
                DialogResult theDialogResult = MessageBox.Show("Vui lòng chọn tên thuốc từ danh sách nhập.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				goto L_0457;
				
			L_0067:
				
				{
				}
				if (! this.check ())
				{
					goto L_0457;
				}
				
			L_0074:
				
				{
				}
				i = 0;
				i2 = 0;
				goto L_0142;
				
			L_007D:
				
				{
				}
				if (this.dsView.Tables["ExportMedicineList"].Rows[i2]["mexISN"].ToString () != this.txtISN.Text)
				{
					goto L_00FD;
				}
				if (this.dsView.Tables["ExportMedicineList"].Rows[i2]["mexISN"].ToString () == "0")
				{
					goto L_00FD;
				}
				i++;
				
			L_00FD:
				
				{
				}
				if (i != 2)
				{
					goto L_013E;
				}
                DialogResult theDialogResult2 = MessageBox.Show("Vui lòng chọn tên thuốc khác. \nT\x00ean thuốc này đã tồn tại trong danh sách thuốc đã kê.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.dsView.Tables["ExportMedicineList"].Rows[i2].Delete ();
				goto L_0457;
				
			L_013E:
				
				{
				}
				i2++;
				
			L_0142:
				
				{
				}
				if (i2 < this.dsView.Tables["ExportMedicineList"].Rows.Count)
				{
					goto L_007D;
				}
				i3 = 0;
				goto L_03B6;
				
			L_016E:
				
				{
				}
				if (this.dsView.Tables["ExportMedicineList"].Rows[i3]["STT"].ToString () != this.txtSTT.Text)
				{
					goto L_03B2;
				}
				this.cboDonVi.Enabled = false;
				this.dsView.Tables["ExportMedicineList"].Rows[i3][1] = this.cboSick.SelectedItem.ToString ();
				this.dsView.Tables["ExportMedicineList"].Rows[i3][3] = this.cboDonVi.Text;
				this.dsView.Tables["ExportMedicineList"].Rows[i3]["mexISN"] = this.txtISN.Text;
				this.dsView.Tables["ExportMedicineList"].Rows[i3][2] = this.tbSoLuong.Text;
				this.dsView.Tables["ExportMedicineList"].Rows[i3][4] = this.tbNgayUong.Text;
				this.dsView.Tables["ExportMedicineList"].Rows[i3][5] = this.tbLanUong.Text;
				this.dsView.Tables["ExportMedicineList"].Rows[i3][6] = this.txtDonVi.Text;
				this.dsView.Tables["ExportMedicineList"].Rows[i3][7] = this.cboCuUong.Text;
				this.dsView.Tables["ExportMedicineList"].Rows[i3][8] = this.cboCachDung.Text;
				this.dsView.Tables["ExportMedicineList"].Rows[i3][9] = this.cboLuuY.Text;
				
			L_03B2:
				
				{
				}
				i3++;
				
			L_03B6:
				
				{
				}
				if (i3 < this.dsView.Tables["ExportMedicineList"].Rows.Count)
				{
					goto L_016E;
				}
				this.txtDonVi.Text = "";
				this.cboCachDung.Text = "";
				this.tbSoLuong.Text = "";
				this.txtDonVi.Text = "";
				this.tbLanUong.Text = "";
				this.tbNgayUong.Text = "";
				this.cboSick.SelectedIndex = 0;
				this.cboLuuY.Text = "";
				
			L_0457:
				return;
			}
			
			private void btXoaToaThuoc_Click (object sender, EventArgs e)
			
			{
				SqlDataAdapter theSqlDataAdapter;
				DataSet theDataSet;
				int i;
				string[] theStringArray;
				SqlDbType[] theSqlDbTypeArray;
				object[] theObjectArray;
                if (this.cboDSLoaiBenh.Text == "Thêm toa thuốc mới")
				{
					goto L_0221;
				}
                if (MessageBox.Show(string.Concat("Bạn có chắc bạn muốn xóa toa thuốc loại bệnh \'", this.cboDSLoaiBenh.Text, "\' không?"), "Information", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
				{
					goto L_021F;
				}
				
			L_0047:
				try
				{
					SqlConnection theSqlConnection = this.db.CreateConnections ();
					theStringArray = new string[1];
					theStringArray[0] = "@samSickName";
					theSqlDbTypeArray = new SqlDbType[1];
					theSqlDbTypeArray[0] = SqlDbType.NVarChar;
					theObjectArray = new object[1];
					theObjectArray[0] = this.cboDSLoaiBenh.Text;
					this.db.ExecuteStoredProc ("sp_SamplePrescription_Delete", theStringArray, theSqlDbTypeArray, theObjectArray);
                    DialogResult theDialogResult = MessageBox.Show("Đã xóa toa thuốc này.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				}
				catch
				{
					
				L_00B1:
					
					{
					}
                    DialogResult theDialogResult2 = MessageBox.Show("Toa thuốc loại bệnh này đã bị xóa.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				}
				
			L_00C7:
				
				{
				}
				this.cboCachDung.Text = "";
				this.tbSoLuong.Text = "";
				this.txtDonVi.Text = "";
				this.tbLanUong.Text = "";
				this.tbNgayUong.Text = "";
				this.cboSick.SelectedIndex = 0;
				this.cboLuuY.Text = "";
				this.txtLoaiBenh.Text = string.Empty;
				this.txtLoaiBenh.ReadOnly = false;
				this.dataGrid1.DataSource = null;
				theSqlDataAdapter = new SqlDataAdapter ("Select distinct samSickName from SamplePrescription", this.connStr);
				theDataSet = new DataSet ();
				int i2 = theSqlDataAdapter.Fill (theDataSet, "SamplePrescription");
				theSqlDataAdapter.Dispose ();
				this.cboDSLoaiBenh.Items.Clear ();
                int i3 = this.cboDSLoaiBenh.Items.Add("Thêm toa thuốc mới");
				if (theDataSet.Tables[0].Rows.Count <= 0)
				{
					goto L_0213;
				}
				i = 0;
				goto L_01FA;
				
			L_01C8:
				
				{
				}
				int i4 = this.cboDSLoaiBenh.Items.Add (theDataSet.Tables[0].Rows[i][0]);
				i++;
				
			L_01FA:
				
				{
				}
				if (i < theDataSet.Tables[0].Rows.Count)
				{
					goto L_01C8;
				}
				
			L_0213:
				
				{
				}
				this.cboDSLoaiBenh.SelectedIndex = 0;
				
			L_021F:
				
				{
				}
				goto L_0234;
				
			L_0221:
				
				{
				}
                DialogResult theDialogResult3 = MessageBox.Show("Vui lòng chọn toa thuốc từ danh sách loại bệnh m\x00e0 bạn muốn xóa.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				
			L_0234:
				return;
			}
			
			private void cboDSLoaiBenh_SelectedIndexChanged (object sender, EventArgs e)
			
			{
				string theString;
				SqlDataAdapter theSqlDataAdapter;
				DataSet theDataSet;
				int i;
				int i2;
				DataRow theDataRow;
				int i3;
                if (this.cboDSLoaiBenh.Text != "Thêm toa thuốc mới")
				{
					goto L_00D9;
				}
				this.txtLoaiBenh.Text = "";
				bool theBoolean = this.txtLoaiBenh.Focus ();
				this.txtLoaiBenh.SelectAll ();
				this.cboCachDung.Text = "";
				this.tbSoLuong.Text = "";
				this.txtDonVi.Text = "";
				this.tbLanUong.Text = "";
				this.tbNgayUong.Text = "";
				this.cboSick.SelectedIndex = 0;
				this.cboLuuY.Text = "";
				this.dataGrid1.DataSource = null;
				this.dtView.Rows.Clear ();
				this.arrTong.Clear ();
				goto L_06FF;
				
			L_00D9:
				
				{
				}
				this.txtLoaiBenh.Text = this.cboDSLoaiBenh.Text;
				bool theBoolean2 = this.txtLoaiBenh.Focus ();
				this.txtLoaiBenh.SelectAll ();
				this.cboCachDung.Text = "";
				this.tbSoLuong.Text = "";
				this.txtDonVi.Text = "";
				this.tbLanUong.Text = "";
				this.tbNgayUong.Text = "";
				this.cboSick.SelectedIndex = 0;
				this.cboLuuY.Text = "";
				this.dataGrid1.DataSource = null;
				this.dtView.Rows.Clear ();
				this.arrTong.Clear ();
				theString = "select samISN as STT, mimID, mexMedicineName as LanDung, mexMedicineName, mexUsa"
				+ "ge, mexQuantityPerUnit, mexProductionPerUnit, mexTakePerDay, mexQuantityPerDay, "
				+ "mexUsagePerDay, mexUsageUnit, mexNote from SamplePrescription where samSickName "
				+ "= @param";
				theSqlDataAdapter = new SqlDataAdapter (theString, this.connStr);
				SqlParameter theSqlParameter = theSqlDataAdapter.SelectCommand.Parameters.Add ("@param", SqlDbType.NVarChar, 100);
				theSqlDataAdapter.SelectCommand.Parameters["@param"].Value = this.cboDSLoaiBenh.Text;
				theDataSet = new DataSet ();
				int i4 = theSqlDataAdapter.Fill (theDataSet, "MedicineExport");
				theSqlDataAdapter.Dispose ();
				if ((theDataSet != null) && ((theDataSet.Tables.Count != 0) && (theDataSet.Tables["MedicineExport"].Rows.Count != 0)))
				{
					goto L_0235;
				}
				
			L_0230:
				
				{
				}
				goto L_06FF;
				
			L_0235:
				
				{
				}
				i = 0;
				goto L_044D;
				
			L_023C:
				
				{
				}
				theDataSet.Tables["MedicineExport"].Rows[i]["STT"] = (i + 1);
				if (theDataSet.Tables["MedicineExport"].Rows[i]["mexProductionPerUnit"].ToString () != "0")
				{
					goto L_02C9;
				}
				theDataSet.Tables["MedicineExport"].Rows[i]["LanDung"] = "viên";
				
			L_02C9:
				
				{
				}
				if (theDataSet.Tables["MedicineExport"].Rows[i]["mexProductionPerUnit"].ToString () != "1")
				{
					goto L_0329;
				}
				theDataSet.Tables["MedicineExport"].Rows[i]["LanDung"] = "ống";
				
			L_0329:
				
				{
				}
				if (theDataSet.Tables["MedicineExport"].Rows[i]["mexProductionPerUnit"].ToString () != "2")
				{
					goto L_0389;
				}
				theDataSet.Tables["MedicineExport"].Rows[i]["LanDung"] = "chai";
				
			L_0389:
				
				{
				}
				if (theDataSet.Tables["MedicineExport"].Rows[i]["mexProductionPerUnit"].ToString () != "3")
				{
					goto L_03E9;
				}
				theDataSet.Tables["MedicineExport"].Rows[i]["LanDung"] = "gói";
				
			L_03E9:
				
				{
				}
				if (theDataSet.Tables["MedicineExport"].Rows[i]["mexProductionPerUnit"].ToString () != "4")
				{
					goto L_0449;
				}
				theDataSet.Tables["MedicineExport"].Rows[i]["LanDung"] = "tuýp";
				
			L_0449:
				
				{
				}
				i++;
				
			L_044D:
				
				{
				}
				if (i < theDataSet.Tables["MedicineExport"].Rows.Count)
				{
					goto L_023C;
				}
				i2 = 0;
				goto L_06D8;
				
			L_0475:
				
				{
				}
				theDataRow = this.dtView.NewRow ();
				theDataRow[0] = (i3 = (i2 + 1)).ToString ();
				theDataRow[1] = theDataSet.Tables["MedicineExport"].Rows[i2]["mexMedicineName"].ToString ();
				theDataRow[2] = theDataSet.Tables["MedicineExport"].Rows[i2]["mexQuantityPerUnit"].ToString ();
				theDataRow[3] = theDataSet.Tables["MedicineExport"].Rows[i2]["LanDung"].ToString ();
				theDataRow[4] = theDataSet.Tables["MedicineExport"].Rows[i2]["mexTakePerDay"].ToString ();
				theDataRow[5] = theDataSet.Tables["MedicineExport"].Rows[i2]["mexQuantityPerDay"].ToString ();
				theDataRow[6] = theDataSet.Tables["MedicineExport"].Rows[i2]["mexUsageUnit"].ToString ();
				theDataRow[7] = theDataSet.Tables["MedicineExport"].Rows[i2]["mexUsagePerDay"].ToString ();
				theDataRow[8] = theDataSet.Tables["MedicineExport"].Rows[i2]["mexUsage"].ToString ();
				theDataRow[9] = theDataSet.Tables["MedicineExport"].Rows[i2]["mexNote"].ToString ();
				theDataRow[10] = 1;
				theDataRow[11] = theDataSet.Tables["MedicineExport"].Rows[i2]["mimID"].ToString ();
				this.dtView.Rows.Add (theDataRow);
				int i5 = this.arrTong.Add (theDataRow[11].ToString ());
				i2++;
				
			L_06D8:
				
				{
				}
				if (i2 < theDataSet.Tables["MedicineExport"].Rows.Count)
				{
					goto L_0475;
				}
				this.loadDataSet ();
				
			L_06FF:
				return;
			}
			
			public bool check ()
			
			{
				bool theBoolean;
				if (this.txtLoaiBenh.Text != "")
				{
					goto L_003D;
				}
                DialogResult theDialogResult = MessageBox.Show("Vui lòng nhập tên loại bệnh.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				bool theBoolean2 = this.txtLoaiBenh.Focus ();
				theBoolean = false;
				goto L_024F;
				
			L_003D:
				
				{
				}
				if (this.cboSick.SelectedItem.ToString () != "-----------Chọn----------")
				{
					goto L_0073;
				}
                DialogResult theDialogResult2 = MessageBox.Show("Vui lòng chọn tên thuốc.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				theBoolean = false;
				goto L_024F;
				
			L_0073:
				
				{
				}
				if (this.cboCachDung.Text != "")
				{
					goto L_00A4;
				}
                DialogResult theDialogResult3 = MessageBox.Show("Vui lòng nhập Cách sử dụng.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				theBoolean = false;
				goto L_024F;
				
			L_00A4:
				
				{
				}
				if (this.tbSoLuong.Text != "")
				{
					goto L_00E1;
				}
                DialogResult theDialogResult4 = MessageBox.Show("Vui lòng nhập số lượng.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				bool theBoolean3 = this.tbSoLuong.Focus ();
				theBoolean = false;
				goto L_024F;
				
			L_00E1:
				
				{
				}
				if (this.tbLanUong.Text != "")
				{
					goto L_011E;
				}
                DialogResult theDialogResult5 = MessageBox.Show("Vui lòng nhập số lượng sử dụng cho một lần.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				bool theBoolean4 = this.tbLanUong.Focus ();
				theBoolean = false;
				goto L_024F;
				
			L_011E:
				
				{
				}
				if (this.txtDonVi.Text != "")
				{
					goto L_015B;
				}
                DialogResult theDialogResult6 = MessageBox.Show("Vui lòng nhập đơn vị Dùng cho từng lần.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				bool theBoolean5 = this.txtDonVi.Focus ();
				theBoolean = false;
				goto L_024F;
				
			L_015B:
				
				{
				}
				if (this.tbNgayUong.Text != "")
				{
					goto L_0198;
				}
                DialogResult theDialogResult7 = MessageBox.Show("Vui lòng nhập số lần sử dụng trong ngày.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				bool theBoolean6 = this.tbNgayUong.Focus ();
				theBoolean = false;
				goto L_024F;
				
			L_0198:
				
				{
				}
				if (this.cboCuUong.Text != "")
				{
					goto L_01C9;
				}
                DialogResult theDialogResult8 = MessageBox.Show("Vui lòng chọn cử uống.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				theBoolean = false;
				goto L_024F;
				
			L_01C9:
				
				{
				}
				if (this.IsNumber (this.tbSoLuong.Text))
				{
					goto L_020A;
				}
                DialogResult theDialogResult9 = MessageBox.Show("Vui lòng nhập kiểu số cho số lượng.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				bool theBoolean7 = this.tbSoLuong.Focus ();
				this.tbSoLuong.SelectAll ();
				theBoolean = false;
				goto L_024F;
				
			L_020A:
				
				{
				}
				if (this.IsNumber (this.tbNgayUong.Text))
				{
					goto L_024B;
				}
                DialogResult theDialogResult10 = MessageBox.Show("Vui lòng nhập kiểu số cho số lần sử dụng trong một ngày.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				bool theBoolean8 = this.tbNgayUong.Focus ();
				this.tbNgayUong.SelectAll ();
				theBoolean = false;
				goto L_024F;
				
			L_024B:
				
				{
				}
				theBoolean = true;
				goto L_024F;
				
			L_024F:
				
				{
				}
				return theBoolean;
			}
			
			private void comboBox1_SelectedIndexChanged (object sender, EventArgs e)
			
			{
				DataSet theDataSet;
				string theString;
				int i;
				if (this.cboSick.SelectedItem.ToString () == "-----------Chọn----------")
				{
					goto L_0199;
				}
				this.cboISN.SelectedIndex = (this.cboSick.SelectedIndex - 1);
				SqlConnection theSqlConnection = this.db.CreateConnections ();
				theDataSet = this.db.Exc_Query (string.Concat ("select mimProductionPerUnit,mesQuantityInStock from vw_MedicineStock where mimID"
				+ " = \'", this.cboISN.SelectedValue.ToString (), "\'"));
				theString = theDataSet.Tables[0].Rows[0][0].ToString ();
				this.txtSoLuongKho.Text = theDataSet.Tables[0].Rows[0][1].ToString ();
				this.txtISN.Text = this.cboISN.SelectedValue.ToString ();
				if (theString != "0")
				{
					goto L_00F6;
				}
				this.txtDonVi.Text = "viên";
				
			L_00F6:
				
				{
				}
				if (theString != "1")
				{
					goto L_0113;
				}
				this.txtDonVi.Text = "ống";
				
			L_0113:
				
				{
				}
				if (theString != "2")
				{
					goto L_0130;
				}
				this.txtDonVi.Text = "chai";
				
			L_0130:
				
				{
				}
				if (theString != "3")
				{
					goto L_014D;
				}
				this.txtDonVi.Text = "gói";
				
			L_014D:
				
				{
				}
				if (theString != "4")
				{
					goto L_016A;
				}
				this.txtDonVi.Text = "tuýp";
				
			L_016A:
				
				{
				}
				i = this.cboDonVi.FindString (this.txtDonVi.Text);
				this.cboDonVi.SelectedIndex = i;
				this.cboDonVi.Enabled = false;
				
			L_0199:
				return;
			}
			
			private void dataGrid1_MouseUp (object sender, MouseEventArgs e)
			
			{
				DataGrid.HitTestInfo theHitTestInfo;
				if (this.dataGrid1.DataSource == null)
				{
					goto L_0326;
				}
				
			L_0012:
				
				{
				}
				if (e.Button != MouseButtons.Left)
				{
					goto L_0326;
				}
				theHitTestInfo = this.dataGrid1.HitTest (e.X, e.Y);
				if (theHitTestInfo.Type != System.Windows.Forms.DataGrid.HitTestType.RowHeader)
				{
					goto L_0326;
				}
				this.tbSoLuong.Text = this.dsView.Tables["ExportMedicineList"].Rows[this.dataGrid1.CurrentRowIndex][2].ToString ();
				this.tbNgayUong.Text = this.dsView.Tables["ExportMedicineList"].Rows[this.dataGrid1.CurrentRowIndex][4].ToString ();
				this.tbNgayUong_Leave (sender, ((EventArgs) e));
				this.tbLanUong.Text = this.dsView.Tables["ExportMedicineList"].Rows[this.dataGrid1.CurrentRowIndex][5].ToString ();
				this.txtDonVi.Text = this.dsView.Tables["ExportMedicineList"].Rows[this.dataGrid1.CurrentRowIndex][6].ToString ();
				this.cboCuUong.SelectedItem = this.dsView.Tables["ExportMedicineList"].Rows[this.dataGrid1.CurrentRowIndex][7].ToString ();
				this.cboCachDung.Text = this.dsView.Tables["ExportMedicineList"].Rows[this.dataGrid1.CurrentRowIndex][8].ToString ();
				this.cboLuuY.Text = this.dsView.Tables["ExportMedicineList"].Rows[this.dataGrid1.CurrentRowIndex][9].ToString ();
				this.txtSTT.Text = this.dsView.Tables["ExportMedicineList"].Rows[this.dataGrid1.CurrentRowIndex]["STT"].ToString ();
				this.cboSick.SelectedItem = this.dsView.Tables["ExportMedicineList"].Rows[this.dataGrid1.CurrentRowIndex]["Tên Thuốc"].ToString ();
				this.cboDonVi.SelectedIndex = this.cboDonVi.FindString (this.dsView.Tables["ExportMedicineList"].Rows[this.dataGrid1.CurrentRowIndex][3].ToString ());
				this.txtISN.Text = this.dsView.Tables["ExportMedicineList"].Rows[this.dataGrid1.CurrentRowIndex]["mexISN"].ToString ();
				
			L_0326:
				return;
			}
			
			protected override void Dispose (bool disposing)
			
			{
				this.flag = 0;
				if (! disposing)
				{
					goto L_001D;
				}
				if (this.components == null)
				{
					goto L_001D;
				}
				this.components.Dispose ();
				
			L_001D:
				
				{
				}
				base.Dispose (disposing);
				return;
			}
			
			private void frmToaThuoHoSoBenhAn_Load (object sender, EventArgs e)
			
			{
				SqlConnection theSqlConnection;
				SqlDataAdapter theSqlDataAdapter;
				DataSet theDataSet;
				int i;
				SqlDataAdapter theSqlDataAdapter2;
				DataSet theDataSet2;
				int i2;
				theSqlConnection = new SqlConnection (this.connStr);
				theSqlDataAdapter = new SqlDataAdapter ("SELECT * FROM vw_MedicineStock", theSqlConnection);
				theDataSet = new DataSet ();
				int i3 = theSqlDataAdapter.Fill (theDataSet, "vw_MedicineStock");
				int i4 = this.cboSick.Items.Add ("-----------Chọn----------");
                int i5 = this.cboDSLoaiBenh.Items.Add("Thêm toa thuốc mới");
				this.cboSick.SelectedIndex = 0;
				this.cboDSLoaiBenh.SelectedIndex = 0;
				int i6 = this.cboDonVi.Items.Add ("-Chọn-");
				int i7 = this.cboDonVi.Items.Add ("viên");
				int i8 = this.cboDonVi.Items.Add ("ống");
				int i9 = this.cboDonVi.Items.Add ("chai");
				int i10 = this.cboDonVi.Items.Add ("gói");
				int i11 = this.cboDonVi.Items.Add ("tuýp");
				this.cboDonVi.SelectedIndex = 0;
				int i12 = this.cboCachDung.Items.Add ("Uống");
				int i13 = this.cboCachDung.Items.Add ("Nhỏ");
				int i14 = this.cboCachDung.Items.Add ("Súc");
				int i15 = this.cboCachDung.Items.Add ("Xịt");
				int i16 = this.cboCachDung.Items.Add ("Thoa");
				int i17 = this.cboCachDung.Items.Add ("Chích");
                int i18 = this.cboLuuY.Items.Add("Uống trước khi ăn");
                int i19 = this.cboLuuY.Items.Add("Uống sau khi ăn");
                int i20 = this.cboLuuY.Items.Add("Uống trước khi ngủ 30 ph\x00fat");
                int i21 = this.cboLuuY.Items.Add("Xịt sau khi rửa mũi");
                int i22 = this.cboLuuY.Items.Add("Thoa l\x00ean vết thương");
                int i23 = this.cboLuuY.Items.Add("Thoa l\x00ean sẹo");
				if ((theDataSet != null) && ((theDataSet.Tables.Count != 0) && (theDataSet.Tables[0].Rows.Count != 0)))
				{
					goto L_0234;
				}
				
			L_022F:
				
				{
				}
				goto L_035F;
				
			L_0234:
				
				{
				}
				i = 0;
				goto L_0277;
				
			L_0238:
				
				{
				}
				int i24 = this.cboSick.Items.Add (theDataSet.Tables["vw_MedicineStock"].Rows[i]["mesMedicineName"].ToString ());
				i++;
				
			L_0277:
				
				{
				}
				if (i < theDataSet.Tables["vw_MedicineStock"].Rows.Count)
				{
					goto L_0238;
				}
				this.cboISN.DataSource = theDataSet;
				this.cboISN.DisplayMember = "vw_MedicineStock.mesMedicineName";
				this.cboISN.ValueMember = "vw_MedicineStock.mimID";
				theSqlDataAdapter2 = new SqlDataAdapter ("Select distinct samSickName from SamplePrescription", this.connStr);
				theDataSet2 = new DataSet ();
				int i25 = theSqlDataAdapter2.Fill (theDataSet2, "SamplePrescription");
				theSqlDataAdapter2.Dispose ();
				if (theDataSet2.Tables[0].Rows.Count <= 0)
				{
					goto L_035F;
				}
				i2 = 0;
				goto L_0344;
				
			L_030E:
				
				{
				}
				int i26 = this.cboDSLoaiBenh.Items.Add (theDataSet2.Tables[0].Rows[i2][0]);
				i2++;
				
			L_0344:
				
				{
				}
				if (i2 < theDataSet2.Tables[0].Rows.Count)
				{
					goto L_030E;
				}
				
			L_035F:
				return;
			}
			
			private void ID_Validate (object sender, KeyPressEventArgs e)
			
			{
				if (char.IsNumber (e.KeyChar))
				{
					goto L_0027;
				}
				if (e.KeyChar == '\u0008')
				{
					goto L_0027;
				}
				if (e.KeyChar == '\r')
				{
					goto L_0027;
				}
				e.Handled = true;
				
			L_0027:
				
				{
				}
				goto L_0029;
				
			L_0029:
				return;
			}
			
			private void InitializeComponent ()
			
			{
				Control[] theControlArray;
				this.components = ((IContainer) new System.ComponentModel.Container ());
				this.label1 = new Label ();
				this.dataGrid1 = new DataGrid ();
				this.btNhap = new Button ();
				this.btThoat = new Button ();
				this.toolTip1 = new ToolTip (this.components);
				this.txtDonVi = new TextBox ();
				this.tbSoLuong = new TextBox ();
				this.tbNgayUong = new TextBox ();
				this.tbLanUong = new TextBox ();
				this.label6 = new Label ();
				this.lbNgayUong = new Label ();
				this.lbLanUong = new Label ();
				this.lbCuUong = new Label ();
				this.cboCuUong = new ComboBox ();
				this.cboSick = new ComboBox ();
				this.label5 = new Label ();
				this.btDelete = new Button ();
				this.btAdd = new Button ();
				this.btUpdate = new Button ();
				this.label10 = new Label ();
				this.txtSTT = new TextBox ();
				this.txtISN = new TextBox ();
				this.label7 = new Label ();
				this.txtSoLuongKho = new TextBox ();
				this.cboDonVi = new ComboBox ();
				this.linkTenThuoc = new LinkLabel ();
				this.txtTenThuoc = new TextBox ();
				this.cboLuuY = new ComboBox ();
				this.cboISN = new ComboBox ();
				this.cboCachDung = new ComboBox ();
				this.label2 = new Label ();
				this.txtLoaiBenh = new TextBox ();
				this.label3 = new Label ();
				this.cboDSLoaiBenh = new ComboBox ();
				this.btXoaToaThuoc = new Button ();
				((ISupportInitialize) this.dataGrid1).BeginInit ();
				base.SuspendLayout ();
				this.label1.Font = new System.Drawing.Font ("Verdana", 12F, FontStyle.Bold, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label1.ForeColor = Color.MediumBlue;
				this.label1.Location = new Point (344, 16);
				this.label1.Name = "label1";
				this.label1.Size = new System.Drawing.Size (152, 23);
				this.label1.TabIndex = 0;
                this.label1.Text = "Toa Thuốc Mẫu";
				this.dataGrid1.BackgroundColor = SystemColors.ActiveCaptionText;
				this.dataGrid1.CaptionVisible = false;
				this.dataGrid1.DataMember = "";
				this.dataGrid1.HeaderForeColor = SystemColors.ControlText;
				this.dataGrid1.Location = new Point (16, 200);
				this.dataGrid1.Name = "dataGrid1";
				this.dataGrid1.ReadOnly = true;
				this.dataGrid1.Size = new System.Drawing.Size (736, 232);
				this.dataGrid1.TabIndex = 18;
				this.dataGrid1.TabStop = false;
				this.dataGrid1.MouseUp += new MouseEventHandler (this.dataGrid1_MouseUp);
				this.btNhap.FlatStyle = FlatStyle.Popup;
				this.btNhap.Location = new Point (504, 440);
				this.btNhap.Name = "btNhap";
				this.btNhap.TabIndex = 19;
				this.btNhap.Text = "Lưu";
				this.btNhap.Click += new EventHandler (this.btNhap_Click);
				this.btThoat.FlatStyle = FlatStyle.Popup;
				this.btThoat.Location = new Point (677, 440);
				this.btThoat.Name = "btThoat";
				this.btThoat.TabIndex = 21;
				this.btThoat.Text = "Thoát";
				this.btThoat.Click += new EventHandler (this.btThoat_Click);
				this.txtDonVi.BorderStyle = BorderStyle.FixedSingle;
				this.txtDonVi.ForeColor = SystemColors.HotTrack;
				this.txtDonVi.Location = new Point (688, 83);
				this.txtDonVi.Name = "txtDonVi";
				this.txtDonVi.Size = new System.Drawing.Size (64, 23);
				this.txtDonVi.TabIndex = 12;
				this.txtDonVi.Text = "";
                this.toolTip1.SetToolTip(((Control)this.txtDonVi), "Đơn vị thuốc dùng trong 1 lần");
				this.tbSoLuong.BorderStyle = BorderStyle.FixedSingle;
				this.tbSoLuong.Location = new Point (504, 57);
				this.tbSoLuong.Name = "tbSoLuong";
				this.tbSoLuong.Size = new System.Drawing.Size (40, 23);
				this.tbSoLuong.TabIndex = 6;
				this.tbSoLuong.Text = "";
				this.tbSoLuong.KeyPress += new KeyPressEventHandler (this.ID_Validate);
				this.tbSoLuong.Leave += new EventHandler (this.tbSoLuong_Leave);
				this.tbNgayUong.BorderStyle = BorderStyle.FixedSingle;
				this.tbNgayUong.Location = new Point (504, 83);
				this.tbNgayUong.Name = "tbNgayUong";
				this.tbNgayUong.Size = new System.Drawing.Size (40, 23);
				this.tbNgayUong.TabIndex = 10;
				this.tbNgayUong.Text = "";
				this.tbNgayUong.KeyPress += new KeyPressEventHandler (this.ID_Validate);
				this.tbNgayUong.Leave += new EventHandler (this.tbNgayUong_Leave);
				this.tbLanUong.BorderStyle = BorderStyle.FixedSingle;
				this.tbLanUong.Location = new Point (632, 83);
				this.tbLanUong.Name = "tbLanUong";
				this.tbLanUong.Size = new System.Drawing.Size (48, 23);
				this.tbLanUong.TabIndex = 11;
				this.tbLanUong.Text = "";
				this.tbLanUong.Leave += new EventHandler (this.tbLanUong_Leave);
				this.label6.Location = new Point (391, 58);
				this.label6.Name = "label6";
				this.label6.Size = new System.Drawing.Size (112, 23);
				this.label6.TabIndex = 33;
                this.label6.Text = "Số lượng:";
				this.label6.TextAlign = ContentAlignment.MiddleRight;
				this.lbNgayUong.Location = new Point (448, 84);
				this.lbNgayUong.Name = "lbNgayUong";
				this.lbNgayUong.Size = new System.Drawing.Size (56, 23);
				this.lbNgayUong.TabIndex = 34;
                this.lbNgayUong.Text = "Ngày :";
				this.lbNgayUong.TextAlign = ContentAlignment.MiddleRight;
				this.lbLanUong.Location = new Point (568, 84);
				this.lbLanUong.Name = "lbLanUong";
				this.lbLanUong.Size = new System.Drawing.Size (64, 23);
				this.lbLanUong.TabIndex = 35;
				this.lbLanUong.Text = "Lần :";
				this.lbLanUong.TextAlign = ContentAlignment.MiddleRight;
				this.lbCuUong.Location = new Point (432, 111);
				this.lbCuUong.Name = "lbCuUong";
				this.lbCuUong.Size = new System.Drawing.Size (72, 23);
				this.lbCuUong.TabIndex = 36;
				this.lbCuUong.Text = "Cử :";
				this.lbCuUong.TextAlign = ContentAlignment.MiddleRight;
				this.cboCuUong.Location = new Point (504, 109);
				this.cboCuUong.Name = "cboCuUong";
				this.cboCuUong.Size = new System.Drawing.Size (248, 24);
				this.cboCuUong.TabIndex = 13;
				this.cboSick.DropDownStyle = ComboBoxStyle.DropDownList;
				this.cboSick.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.cboSick.ItemHeight = 16;
				this.cboSick.Location = new Point (176, 109);
				this.cboSick.Name = "cboSick";
				this.cboSick.Size = new System.Drawing.Size (208, 24);
				this.cboSick.TabIndex = 4;
				this.cboSick.SelectedIndexChanged += new EventHandler (this.comboBox1_SelectedIndexChanged);
				this.label5.Location = new Point (93, 136);
				this.label5.Name = "label5";
				this.label5.Size = new System.Drawing.Size (82, 23);
				this.label5.TabIndex = 47;
				this.label5.Text = "Cách dùng:";
				this.label5.TextAlign = ContentAlignment.MiddleLeft;
				this.btDelete.FlatStyle = FlatStyle.Popup;
				this.btDelete.Location = new Point (678, 166);
				this.btDelete.Name = "btDelete";
				this.btDelete.Size = new System.Drawing.Size (74, 23);
				this.btDelete.TabIndex = 17;
				this.btDelete.Text = "Xóa";
				this.btDelete.Click += new EventHandler (this.btDelete_Click);
				this.btAdd.FlatStyle = FlatStyle.Popup;
				this.btAdd.Location = new Point (504, 166);
				this.btAdd.Name = "btAdd";
				this.btAdd.Size = new System.Drawing.Size (64, 23);
				this.btAdd.TabIndex = 15;
				this.btAdd.Text = "Nhập";
				this.btAdd.Click += new EventHandler (this.btAdd_Click);
				this.btUpdate.FlatStyle = FlatStyle.Popup;
				this.btUpdate.Location = new Point (580, 166);
				this.btUpdate.Name = "btUpdate";
				this.btUpdate.Size = new System.Drawing.Size (85, 23);
				this.btUpdate.TabIndex = 16;
				this.btUpdate.Text = "Cập Nhật";
				this.btUpdate.Click += new EventHandler (this.btUpdate_Click);
				this.label10.Location = new Point (431, 135);
				this.label10.Name = "label10";
				this.label10.Size = new System.Drawing.Size (72, 23);
				this.label10.TabIndex = 49;
				this.label10.Text = "Lưu ý:";
				this.label10.TextAlign = ContentAlignment.MiddleRight;
				this.txtSTT.BorderStyle = BorderStyle.FixedSingle;
				this.txtSTT.Location = new Point (496, 16);
				this.txtSTT.Name = "txtSTT";
				this.txtSTT.Size = new System.Drawing.Size (80, 23);
				this.txtSTT.TabIndex = 52;
				this.txtSTT.Text = "";
				this.txtSTT.Visible = false;
				this.txtISN.BorderStyle = BorderStyle.FixedSingle;
				this.txtISN.Location = new Point (584, 16);
				this.txtISN.Name = "txtISN";
				this.txtISN.Size = new System.Drawing.Size (80, 23);
				this.txtISN.TabIndex = 53;
				this.txtISN.Text = "";
				this.txtISN.Visible = false;
				this.label7.Location = new Point (560, 58);
				this.label7.Name = "label7";
				this.label7.Size = new System.Drawing.Size (72, 23);
				this.label7.TabIndex = 7;
                this.label7.Text = "Đơn vị:";
				this.label7.TextAlign = ContentAlignment.MiddleRight;
				this.txtSoLuongKho.BorderStyle = BorderStyle.FixedSingle;
				this.txtSoLuongKho.Enabled = false;
				this.txtSoLuongKho.Location = new Point (672, 16);
				this.txtSoLuongKho.Name = "txtSoLuongKho";
				this.txtSoLuongKho.Size = new System.Drawing.Size (89, 23);
				this.txtSoLuongKho.TabIndex = 56;
				this.txtSoLuongKho.Text = "";
				this.txtSoLuongKho.Visible = false;
				this.cboDonVi.DropDownStyle = ComboBoxStyle.DropDownList;
				this.cboDonVi.Enabled = false;
				this.cboDonVi.Location = new Point (632, 56);
				this.cboDonVi.Name = "cboDonVi";
				this.cboDonVi.Size = new System.Drawing.Size (120, 24);
				this.cboDonVi.TabIndex = 9;
				this.linkTenThuoc.Location = new Point (73, 110);
				this.linkTenThuoc.Name = "linkTenThuoc";
				this.linkTenThuoc.TabIndex = 3;
				this.linkTenThuoc.TabStop = true;
                this.linkTenThuoc.Text = "Tên Thuốc :";
				this.linkTenThuoc.TextAlign = ContentAlignment.MiddleRight;
				this.linkTenThuoc.LinkClicked += new LinkLabelLinkClickedEventHandler (this.linkTenThuoc_LinkClicked);
				this.txtTenThuoc.BorderStyle = BorderStyle.FixedSingle;
				this.txtTenThuoc.ForeColor = SystemColors.HotTrack;
				this.txtTenThuoc.Location = new Point (176, 109);
				this.txtTenThuoc.Name = "txtTenThuoc";
				this.txtTenThuoc.Size = new System.Drawing.Size (208, 23);
				this.txtTenThuoc.TabIndex = 0;
				this.txtTenThuoc.Text = "";
				this.txtTenThuoc.Visible = false;
				this.txtTenThuoc.KeyPress += new KeyPressEventHandler (this.txtTenThuoc_KeyPress);
				this.txtTenThuoc.Leave += new EventHandler (this.txtTenThuoc_Leave);
				this.cboLuuY.Location = new Point (504, 136);
				this.cboLuuY.Name = "cboLuuY";
				this.cboLuuY.Size = new System.Drawing.Size (248, 24);
				this.cboLuuY.TabIndex = 14;
				this.cboISN.DropDownStyle = ComboBoxStyle.DropDownList;
				this.cboISN.Location = new Point (306, 136);
				this.cboISN.Name = "cboISN";
				this.cboISN.Size = new System.Drawing.Size (80, 24);
				this.cboISN.TabIndex = 70;
				this.cboISN.Visible = false;
				this.cboCachDung.Location = new Point (176, 136);
				this.cboCachDung.Name = "cboCachDung";
				this.cboCachDung.Size = new System.Drawing.Size (112, 24);
				this.cboCachDung.TabIndex = 5;
				this.label2.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label2.Location = new Point (96, 83);
				this.label2.Name = "label2";
				this.label2.Size = new System.Drawing.Size (80, 23);
				this.label2.TabIndex = 30;
                this.label2.Text = "Loại bệnh:";
				this.label2.TextAlign = ContentAlignment.MiddleRight;
				this.txtLoaiBenh.BorderStyle = BorderStyle.FixedSingle;
				this.txtLoaiBenh.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.txtLoaiBenh.ForeColor = SystemColors.HotTrack;
				this.txtLoaiBenh.Location = new Point (176, 83);
				this.txtLoaiBenh.Name = "txtLoaiBenh";
				this.txtLoaiBenh.Size = new System.Drawing.Size (208, 23);
				this.txtLoaiBenh.TabIndex = 2;
				this.txtLoaiBenh.Text = "";
				this.label3.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label3.Location = new Point (24, 56);
				this.label3.Name = "label3";
				this.label3.Size = new System.Drawing.Size (152, 23);
				this.label3.TabIndex = 31;
                this.label3.Text = "Danh sách loại bệnh:";
				this.label3.TextAlign = ContentAlignment.MiddleRight;
				this.cboDSLoaiBenh.DropDownStyle = ComboBoxStyle.DropDownList;
				this.cboDSLoaiBenh.Location = new Point (176, 56);
				this.cboDSLoaiBenh.Name = "cboDSLoaiBenh";
				this.cboDSLoaiBenh.Size = new System.Drawing.Size (208, 24);
				this.cboDSLoaiBenh.TabIndex = 1;
				this.cboDSLoaiBenh.SelectedIndexChanged += new EventHandler (this.cboDSLoaiBenh_SelectedIndexChanged);
				this.btXoaToaThuoc.FlatStyle = FlatStyle.Popup;
				this.btXoaToaThuoc.Location = new Point (592, 440);
				this.btXoaToaThuoc.Name = "btXoaToaThuoc";
				this.btXoaToaThuoc.Size = new System.Drawing.Size (74, 23);
				this.btXoaToaThuoc.TabIndex = 20;
				this.btXoaToaThuoc.Text = "Xóa";
				this.btXoaToaThuoc.Click += new EventHandler (this.btXoaToaThuoc_Click);
				this.AutoScaleBaseSize = new System.Drawing.Size (7, 16);
				base.ClientSize = new System.Drawing.Size (774, 467);
				theControlArray = new Control[34];
				theControlArray[0] = ((Control) this.btXoaToaThuoc);
				theControlArray[1] = ((Control) this.cboDSLoaiBenh);
				theControlArray[2] = ((Control) this.cboCachDung);
				theControlArray[3] = ((Control) this.cboISN);
				theControlArray[4] = ((Control) this.label1);
				theControlArray[5] = ((Control) this.cboLuuY);
				theControlArray[6] = ((Control) this.linkTenThuoc);
				theControlArray[7] = ((Control) this.cboDonVi);
				theControlArray[8] = ((Control) this.txtSoLuongKho);
				theControlArray[9] = ((Control) this.label5);
				theControlArray[10] = ((Control) this.txtISN);
				theControlArray[11] = ((Control) this.txtSTT);
				theControlArray[12] = ((Control) this.txtDonVi);
				theControlArray[13] = ((Control) this.label10);
				theControlArray[14] = ((Control) this.txtLoaiBenh);
				theControlArray[15] = ((Control) this.btUpdate);
				theControlArray[16] = ((Control) this.btDelete);
				theControlArray[17] = ((Control) this.btAdd);
				theControlArray[18] = ((Control) this.cboCuUong);
				theControlArray[19] = ((Control) this.tbSoLuong);
				theControlArray[20] = ((Control) this.label2);
				theControlArray[21] = ((Control) this.tbNgayUong);
				theControlArray[22] = ((Control) this.label3);
				theControlArray[23] = ((Control) this.tbLanUong);
				theControlArray[24] = ((Control) this.label6);
				theControlArray[25] = ((Control) this.lbNgayUong);
				theControlArray[26] = ((Control) this.lbLanUong);
				theControlArray[27] = ((Control) this.lbCuUong);
				theControlArray[28] = ((Control) this.btThoat);
				theControlArray[29] = ((Control) this.btNhap);
				theControlArray[30] = ((Control) this.dataGrid1);
				theControlArray[31] = ((Control) this.label7);
				theControlArray[32] = ((Control) this.cboSick);
				theControlArray[33] = ((Control) this.txtTenThuoc);
				base.Controls.AddRange (theControlArray);
				this.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
				base.MaximizeBox = false;
				base.MinimizeBox = false;
				base.Name = "frmToaThuocMau";
				base.StartPosition = FormStartPosition.CenterScreen;
                this.Text = "Toa Thuốc Mẫu";
				base.Load += new EventHandler (this.frmToaThuoHoSoBenhAn_Load);
				((ISupportInitialize) this.dataGrid1).EndInit ();
				base.ResumeLayout (false);
				return;
			}
			
			private bool IsNumber (string Number)
			
			{
				bool theBoolean;
				
			L_0000:
				try
				{
					long theLong = long.Parse (Number);
					theBoolean = true;
				}
				catch
				{
					
				L_000B:
					
					{
					}
					theBoolean = false;
				}
				
			L_0010:
				
				{
				}
				return theBoolean;
			}
			
			private void linkTenThuoc_LinkClicked (object sender, LinkLabelLinkClickedEventArgs e)
			
			{
				if (! this.cboSick.Visible)
				{
					goto L_0027;
				}
				this.cboSick.Visible = false;
				this.txtTenThuoc.Visible = true;
				goto L_003F;
				
			L_0027:
				
				{
				}
				this.cboSick.Visible = true;
				this.txtTenThuoc.Visible = false;
				
			L_003F:
				return;
			}
			
			public void loadDataGrid ()
			
			{
				DataGridTableStyle theDataGridTableStyle;
				DataGridTextBoxColumn theDataGridTextBoxColumn;
				DataGridTextBoxColumn theDataGridTextBoxColumn2;
				DataGridTextBoxColumn theDataGridTextBoxColumn3;
				DataGridTextBoxColumn theDataGridTextBoxColumn4;
				DataGridTextBoxColumn theDataGridTextBoxColumn5;
				DataGridTextBoxColumn theDataGridTextBoxColumn6;
				DataGridTextBoxColumn theDataGridTextBoxColumn7;
				DataGridTextBoxColumn theDataGridTextBoxColumn8;
				DataGridTextBoxColumn theDataGridTextBoxColumn9;
				DataGridTextBoxColumn theDataGridTextBoxColumn10;
				DataGridTextBoxColumn theDataGridTextBoxColumn11;
				DataGridTextBoxColumn theDataGridTextBoxColumn12;
				theDataGridTableStyle = new DataGridTableStyle ();
				theDataGridTableStyle.MappingName = "ExportMedicineList";
				theDataGridTableStyle.AlternatingBackColor = Color.AliceBlue;
				theDataGridTableStyle.HeaderForeColor = Color.Maroon;
				theDataGridTableStyle.GridLineColor = Color.CornflowerBlue;
				theDataGridTextBoxColumn = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn.MappingName = "STT";
				theDataGridTextBoxColumn.HeaderText = "STT";
				theDataGridTextBoxColumn.Width = 100;
				theDataGridTextBoxColumn.NullText = string.Empty;
				int i = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn));
				theDataGridTextBoxColumn2 = new DataGridTextBoxColumn ();
                theDataGridTextBoxColumn2.MappingName = "Tên Thuốc";
                theDataGridTextBoxColumn2.HeaderText = "Tên Thuốc";
				theDataGridTextBoxColumn2.Width = 185;
				theDataGridTextBoxColumn2.NullText = string.Empty;
				int i2 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn2));
				theDataGridTextBoxColumn3 = new DataGridTextBoxColumn ();
                theDataGridTextBoxColumn3.MappingName = "Số Lượng";
                theDataGridTextBoxColumn3.HeaderText = "Số Lượng";
				theDataGridTextBoxColumn3.Width = 120;
				theDataGridTextBoxColumn3.NullText = string.Empty;
				theDataGridTextBoxColumn3.Alignment = HorizontalAlignment.Center;
				int i3 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn3));
				theDataGridTextBoxColumn4 = new DataGridTextBoxColumn ();
                theDataGridTextBoxColumn4.MappingName = "Đơn Vị";
                theDataGridTextBoxColumn4.HeaderText = "Đơn Vị";
				theDataGridTextBoxColumn4.Width = 120;
				theDataGridTextBoxColumn4.NullText = string.Empty;
				theDataGridTextBoxColumn4.Alignment = HorizontalAlignment.Center;
				int i4 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn4));
				theDataGridTextBoxColumn5 = new DataGridTextBoxColumn ();
                theDataGridTextBoxColumn5.MappingName = "Ngày SD/ Lần";
                theDataGridTextBoxColumn5.HeaderText = "Ngày SD/ Lần";
				theDataGridTextBoxColumn5.Width = 120;
				theDataGridTextBoxColumn5.NullText = string.Empty;
				theDataGridTextBoxColumn5.Alignment = HorizontalAlignment.Center;
				int i5 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn5));
				theDataGridTextBoxColumn6 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn6.MappingName = "Lần";
				theDataGridTextBoxColumn6.HeaderText = "Lần";
				theDataGridTextBoxColumn6.Width = 117;
				theDataGridTextBoxColumn6.NullText = string.Empty;
				theDataGridTextBoxColumn6.Alignment = HorizontalAlignment.Center;
				int i6 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn6));
				theDataGridTextBoxColumn7 = new DataGridTextBoxColumn ();
                theDataGridTextBoxColumn7.MappingName = "Đơn Vị Dùng";
                theDataGridTextBoxColumn7.HeaderText = "Đơn Vị Dùng";
				theDataGridTextBoxColumn7.Width = 120;
				theDataGridTextBoxColumn7.NullText = string.Empty;
				int i7 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn7));
				theDataGridTextBoxColumn8 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn8.MappingName = "Cử";
                theDataGridTextBoxColumn8.HeaderText = "Cử";
				theDataGridTextBoxColumn8.Width = 195;
				theDataGridTextBoxColumn8.NullText = string.Empty;
				int i8 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn8));
				theDataGridTextBoxColumn9 = new DataGridTextBoxColumn ();
                theDataGridTextBoxColumn9.MappingName = "Cách SD";
                theDataGridTextBoxColumn9.HeaderText = "Cách Sử Dụng";
				theDataGridTextBoxColumn9.Width = 120;
				theDataGridTextBoxColumn9.NullText = string.Empty;
				int i9 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn9));
				theDataGridTextBoxColumn10 = new DataGridTextBoxColumn ();
                theDataGridTextBoxColumn10.MappingName = "Lưu \x00dd";
                theDataGridTextBoxColumn10.HeaderText = "Lưu \x00dd";
				theDataGridTextBoxColumn10.Width = 195;
				theDataGridTextBoxColumn10.NullText = string.Empty;
				int i10 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn10));
				theDataGridTextBoxColumn11 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn11.MappingName = "YesOrNo";
				theDataGridTextBoxColumn11.HeaderText = "";
				theDataGridTextBoxColumn11.Width = 0;
				theDataGridTextBoxColumn11.NullText = string.Empty;
				int i11 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn11));
				theDataGridTextBoxColumn12 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn12.MappingName = "mexISN";
				theDataGridTextBoxColumn12.HeaderText = "";
				theDataGridTextBoxColumn12.Width = 0;
				theDataGridTextBoxColumn12.NullText = string.Empty;
				int i12 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn12));
				int i13 = this.dataGrid1.TableStyles.Add (theDataGridTableStyle);
				theDataGridTableStyle.AllowSorting = false;
				return;
			}
			
			public void loadDataSet ()
			
			{
				this.dsView.Tables.Clear ();
				this.dsView.Tables.Add (this.dtView);
				this.dataGrid1.TableStyles.Clear ();
				this.dataGrid1.DataSource = this.dsView;
				this.dataGrid1.SetDataBinding (this.dsView, "ExportMedicineList");
				this.loadDataGrid ();
				return;
			}
			
			private void tbLanUong_Leave (object sender, EventArgs e)
			
			{
				long theLong;
				ArrayList theArrayList;
				string theString;
				long theLong2;
				long theLong3;
				string[] theStringArray;
				char[] theCharArray;
				int i;
				if (! this.IsNumber (this.tbLanUong.Text))
				{
					goto L_005D;
				}
				theLong = Convert.ToInt64 (this.tbLanUong.Text);
				if (theLong != ((long) 0))
				{
					goto L_0058;
				}
                DialogResult theDialogResult = MessageBox.Show("Vui lòng nhập số liều Dùng cho một lần lớn hơn 0.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				bool theBoolean = this.tbLanUong.Focus ();
				this.tbLanUong.SelectAll ();
				goto L_0134;
				
			L_0058:
				
				{
				}
				goto L_0134;
				
			L_005D:
				
				{
				}
				theArrayList = new ArrayList ();
				theCharArray = new char[1];
				theCharArray[0] = '\u002F';
				theStringArray = this.tbLanUong.Text.Trim ().Split (theCharArray);
				i = 0;
				goto L_00A3;
				
			L_008F:
				
				{
				}
				theString = theStringArray[i];
				int i2 = theArrayList.Add (theString);
				i++;
				
			L_00A3:
				
				{
				}
				if (i < theStringArray.Length)
				{
					goto L_008F;
				}
				if (theArrayList.Count < 3)
				{
					goto L_00E0;
				}
                DialogResult theDialogResult2 = MessageBox.Show("Chỉ nên nhập 1 số có dạng A/B.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				bool theBoolean2 = this.tbLanUong.Focus ();
				this.tbLanUong.SelectAll ();
				goto L_0134;
				
			L_00E0:
				try
				{
					theLong2 = Convert.ToInt64 (theArrayList[0].ToString ());
					theLong3 = Convert.ToInt64 (theArrayList[1].ToString ());
				}
				catch
				{
					
				L_0107:
					
					{
					}
                    DialogResult theDialogResult3 = MessageBox.Show("Nhập kiểu số cho số liều sử dụng trong một lần.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Hand);
					bool theBoolean3 = this.tbLanUong.Focus ();
					this.tbLanUong.SelectAll ();
				}
				
			L_0134:
				return;
			}
			
			private void tbNgayUong_Leave (object sender, EventArgs e)
			
			{
				if (this.tbNgayUong.Text == "")
				{
					goto L_002A;
				}
				
			L_0019:
				
				{
				}
				this.textInComboCuUong (this.tbNgayUong.Text);
				
			L_002A:
				return;
			}
			
			private void tbSoLuong_Leave (object sender, EventArgs e)
			
			{
				return;
			}
			
			public void textInComboCuUong (string ngay)
			
			{
				ArrayList theArrayList;
				ArrayList theArrayList2;
				int i;
				int i2;
				int i3;
				int i4;
				int i5;
				int i6;
				int i7;
				int i8;
				int i9;
				string[] theStringArray;
				string[] theStringArray2;
				string[] theStringArray3;
				string[] theStringArray4;
				string[] theStringArray5;
				string[] theStringArray6;
				if (! this.IsNumber (ngay))
				{
					goto L_05BC;
				}
				
			L_000E:
				
				{
				}
				theArrayList = new ArrayList ();
				int i10 = theArrayList.Add ("sáng");
				int i11 = theArrayList.Add ("trưa");
				int i12 = theArrayList.Add ("chiều");
				int i13 = theArrayList.Add ("tối");
				theArrayList2 = new ArrayList ();
				i = Convert.ToInt32 (ngay);
				if (i >= 5)
				{
					goto L_0300;
				}
				i9 = i;
				switch (i9 - 1)
				{
					case 0:
					
					{
							goto L_0079;
					}
					case 1:
					
					{
							goto L_00A2;
					}
					case 2:
					
					{
							goto L_0191;
					}
					case 3:
					
					{
							goto L_02ED;
					}
				}
				goto L_02FB;
				
			L_0079:
				
				{
				}
				i2 = 0;
				goto L_0094;
				
			L_007D:
				
				{
				}
				int i14 = theArrayList2.Add (theArrayList[i2].ToString ());
				i2++;
				
			L_0094:
				
				{
				}
				if (i2 < theArrayList.Count)
				{
					goto L_007D;
				}
				goto L_02FB;
				
			L_00A2:
				
				{
				}
				i3 = 0;
				goto L_0156;
				
			L_00AA:
				
				{
				}
				if (i3 == (theArrayList.Count - 1))
				{
					goto L_0163;
				}
				
			L_00BB:
				
				{
				}
				int i15 = theArrayList2.Add (string.Concat (theArrayList[i3].ToString (), ",", theArrayList[((int) (i3 + 1))].ToString ()));
				int i16 = theArrayList2.Add (string.Concat (theArrayList[i3].ToString (), ",", theArrayList[((int) (i3 + 2))].ToString ()));
				if (i3 == (theArrayList.Count - 3))
				{
					goto L_0163;
				}
				
			L_0123:
				
				{
				}
				int i17 = theArrayList2.Add (string.Concat (theArrayList[i3].ToString (), ",", theArrayList[((int) (i3 + 3))].ToString ()));
				i3++;
				
			L_0156:
				
				{
				}
				if (i3 < theArrayList.Count)
				{
					goto L_00AA;
				}
				
			L_0163:
				
				{
				}
				int i18 = theArrayList2.Add (string.Concat (theArrayList[2].ToString (), ",", theArrayList[3].ToString ()));
				goto L_02FB;
				
			L_0191:
				
				{
				}
				i4 = 0;
				goto L_02DE;
				
			L_0199:
				
				{
				}
				if (i4 == (theArrayList.Count - 2))
				{
					goto L_02EB;
				}
				
			L_01AA:
				
				{
				}
				theStringArray = new string[5];
				theStringArray[0] = theArrayList[i4].ToString ();
				theStringArray[1] = ",";
				theStringArray[2] = theArrayList[((int) (i4 + 1))].ToString ();
				theStringArray[3] = ",";
				theStringArray[4] = theArrayList[((int) (i4 + 2))].ToString ();
				int i19 = theArrayList2.Add (string.Concat (theStringArray));
				if (i4 == (theArrayList.Count - 3))
				{
					goto L_02EB;
				}
				
			L_021A:
				
				{
				}
				theStringArray2 = new string[5];
				theStringArray2[0] = theArrayList[i4].ToString ();
				theStringArray2[1] = ",";
				theStringArray2[2] = theArrayList[((int) (i4 + 1))].ToString ();
				theStringArray2[3] = ",";
				theStringArray2[4] = theArrayList[((int) (i4 + 3))].ToString ();
				int i20 = theArrayList2.Add (string.Concat (theStringArray2));
				theStringArray3 = new string[5];
				theStringArray3[0] = theArrayList[i4].ToString ();
				theStringArray3[1] = ",";
				theStringArray3[2] = theArrayList[((int) (i4 + 2))].ToString ();
				theStringArray3[3] = ",";
				theStringArray3[4] = theArrayList[((int) (i4 + 3))].ToString ();
				int i21 = theArrayList2.Add (string.Concat (theStringArray3));
				i4++;
				
			L_02DE:
				
				{
				}
				if (i4 < theArrayList.Count)
				{
					goto L_0199;
				}
				
			L_02EB:
				
				{
				}
				goto L_02FB;
				
			L_02ED:
				
				{
				}
				int i22 = theArrayList2.Add ("sáng,trưa,chiều,tối");
				goto L_02FB;
				
			L_02FB:
				
				{
				}
				goto L_0579;
				
			L_0300:
				
				{
				}
				i5 = 0;
				goto L_031F;
				
			L_0305:
				
				{
				}
				int i23 = theArrayList2.Add (theArrayList[i5].ToString ());
				i5++;
				
			L_031F:
				
				{
				}
				if (i5 < theArrayList.Count)
				{
					goto L_0305;
				}
				i6 = 0;
				goto L_03DD;
				
			L_0331:
				
				{
				}
				if (i6 == (theArrayList.Count - 1))
				{
					goto L_03EA;
				}
				
			L_0342:
				
				{
				}
				int i24 = theArrayList2.Add (string.Concat (theArrayList[i6].ToString (), ",", theArrayList[((int) (i6 + 1))].ToString ()));
				int i25 = theArrayList2.Add (string.Concat (theArrayList[i6].ToString (), ",", theArrayList[((int) (i6 + 2))].ToString ()));
				if (i6 == (theArrayList.Count - 3))
				{
					goto L_03EA;
				}
				
			L_03AA:
				
				{
				}
				int i26 = theArrayList2.Add (string.Concat (theArrayList[i6].ToString (), ",", theArrayList[((int) (i6 + 3))].ToString ()));
				i6++;
				
			L_03DD:
				
				{
				}
				if (i6 < theArrayList.Count)
				{
					goto L_0331;
				}
				
			L_03EA:
				
				{
				}
				int i27 = theArrayList2.Add (string.Concat (theArrayList[2].ToString (), ",", theArrayList[3].ToString ()));
				i7 = 0;
				goto L_0560;
				
			L_041B:
				
				{
				}
				if (i7 == (theArrayList.Count - 2))
				{
					goto L_056D;
				}
				
			L_042C:
				
				{
				}
				theStringArray4 = new string[5];
				theStringArray4[0] = theArrayList[i7].ToString ();
				theStringArray4[1] = ",";
				theStringArray4[2] = theArrayList[((int) (i7 + 1))].ToString ();
				theStringArray4[3] = ",";
				theStringArray4[4] = theArrayList[((int) (i7 + 2))].ToString ();
				int i28 = theArrayList2.Add (string.Concat (theStringArray4));
				if (i7 == (theArrayList.Count - 3))
				{
					goto L_056D;
				}
				
			L_049C:
				
				{
				}
				theStringArray5 = new string[5];
				theStringArray5[0] = theArrayList[i7].ToString ();
				theStringArray5[1] = ",";
				theStringArray5[2] = theArrayList[((int) (i7 + 1))].ToString ();
				theStringArray5[3] = ",";
				theStringArray5[4] = theArrayList[((int) (i7 + 3))].ToString ();
				int i29 = theArrayList2.Add (string.Concat (theStringArray5));
				theStringArray6 = new string[5];
				theStringArray6[0] = theArrayList[i7].ToString ();
				theStringArray6[1] = ",";
				theStringArray6[2] = theArrayList[((int) (i7 + 2))].ToString ();
				theStringArray6[3] = ",";
				theStringArray6[4] = theArrayList[((int) (i7 + 3))].ToString ();
				int i30 = theArrayList2.Add (string.Concat (theStringArray6));
				i7++;
				
			L_0560:
				
				{
				}
				if (i7 < theArrayList.Count)
				{
					goto L_041B;
				}
				
			L_056D:
				
				{
				}
				int i31 = theArrayList2.Add ("s\x00e1ng,trưa,chiều,tối");
				
			L_0579:
				
				{
				}
				this.cboCuUong.Items.Clear ();
				i8 = 0;
				goto L_05B2;
				
			L_058E:
				
				{
				}
				int i32 = this.cboCuUong.Items.Add (theArrayList2[i8].ToString ());
				i8++;
				
			L_05B2:
				
				{
				}
				if (i8 < theArrayList2.Count)
				{
					goto L_058E;
				}
				
			L_05BC:
				return;
			}
			
			private void txtTenThuoc_KeyPress (object sender, KeyPressEventArgs e)
			
			{
				int i;
				if (e.KeyChar != '\r')
				{
					goto L_0060;
				}
				i = this.cboSick.FindString (this.txtTenThuoc.Text);
				if (i < 0)
				{
					goto L_004B;
				}
				this.cboSick.Visible = true;
				this.txtTenThuoc.Visible = false;
				this.cboSick.SelectedIndex = i;
				goto L_0060;
				
			L_004B:
				
				{
				}
                DialogResult theDialogResult = MessageBox.Show("Tên thuốc này không tồn tại.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				goto L_0060;
				
			L_0060:
				return;
			}
			
			private void txtTenThuoc_Leave (object sender, EventArgs e)
			
			{
				int i;
				i = this.cboSick.FindString (this.txtTenThuoc.Text);
				if (i < 0)
				{
					goto L_0041;
				}
				this.cboSick.Visible = true;
				this.txtTenThuoc.Visible = false;
				this.cboSick.SelectedIndex = i;
				goto L_0056;
				
			L_0041:
				
				{
				}
                DialogResult theDialogResult = MessageBox.Show("Tên thuốc này không tồn tại.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				goto L_0056;
				
			L_0056:
				return;
			}
			
		#endregion
	}
	
}

